/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.product.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.business.product.facade.enums.ProductStatus;
import info.peigen.hotpot.common.core.enums.SortType;
import info.peigen.hotpot.common.core.enums.YesOrNo;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(ProductCategoryEntity)</b>
 * 产品真实类目
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/11/3
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "product_category", comment = "产品真实类目", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "product_category")
public class ProductCategoryEntity extends AbstractCreateTimeEntity {
    @Column(name = "category_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "类目Id")
    @org.beetl.sql.annotation.entity.Column("category_id")
    @Unique(value = "categoryId", columns = "category_id")
    String        categoryId;
    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, length = 100, isNull = false, comment = "类目名")
    @org.beetl.sql.annotation.entity.Column("name")
    @Unique(value = "name", columns = "name")
    String        name;
    @Column(name = "parent_id", type = MySqlTypeConstant.VARCHAR, length = 30, comment = "父类目Id")
    @org.beetl.sql.annotation.entity.Column("parent_id")
    @Index(value = "parentId", columns = "parent_id")
    String        parentId;
    @Column(name = "leaf", type = MySqlTypeConstant.VARCHAR, length = 10, comment = "是否叶子节点")
    @org.beetl.sql.annotation.entity.Column("leaf")
    YesOrNo       leaf;
    @Column(name = "level", type = MySqlTypeConstant.VARCHAR, length = 10, comment = "类目层级")
    @org.beetl.sql.annotation.entity.Column("level")
    Integer       level;
    @Column(name = "path", type = MySqlTypeConstant.VARCHAR, length = 300, comment = "完整父级路径：父父id_父id")
    @org.beetl.sql.annotation.entity.Column("path")
    String        path;
    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "上架状态")
    @org.beetl.sql.annotation.entity.Column("status")
    @Index(value = "status", columns = "status")
    ProductStatus status;
    @Column(name = "sort", type = MySqlTypeConstant.VARCHAR, length = 10, comment = "排序")
    @org.beetl.sql.annotation.entity.Column("sort")
    SortType      sort;
    @Column(name = "operator_id", type = MySqlTypeConstant.VARCHAR, length = 30, comment = "操作员Id")
    @org.beetl.sql.annotation.entity.Column("operator_id")
    String        operatorId;
}